package com.yaodian100.mall.category.web;

import com.opensymphony.xwork2.ActionSupport;
import com.yaodian100.ec.product.entity.Brand;
import com.yaodian100.ec.product.service.ProductService;

/**
 * 品牌專區
 * 
 * @author apple.chang
 * 
 */
public class BrandAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2704073307900376478L;

	private ProductService productService;
	private String brandId;
	private Brand brand;
	private boolean inBrandZone;

	/**
	 * 品牌专区
	 * 
	 * @return
	 */
	public String brandZone() {
		setInBrandZone(true);
		return "brand_index";
	}

	/**
	 * 品牌
	 * 
	 * @return
	 */
	public String brand() {
		brand = productService.getBrandByBrandId(brandId);
		if (null != brand) {
			brand.setBrandStory(productService.readBrandFromFile(brandId));
		}
		return "brand";
	}

	public ProductService getProductService() {
		return productService;
	}

	public void setProductService(ProductService productService) {
		this.productService = productService;
	}

	public Brand getBrand() {
		return brand;
	}

	public void setBrand(Brand brand) {
		this.brand = brand;
	}

	public String getBrandId() {
		return brandId;
	}

	public void setBrandId(String brandId) {
		this.brandId = brandId;
	}

	public boolean isInBrandZone() {
		return this.inBrandZone;
	}
	public void setInBrandZone(boolean inBrandZone) {
		this.inBrandZone = inBrandZone;
	}

}